package com.xhu.water_supply.web.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description Web拦截器配置
 * @Author 老九学堂
 * @Copy &copy;<a href="http://www.xuetang9.com">老九学堂</a>
 * @Address 老九学堂总部
 */
@Configuration
public class WebApplicationConfig implements WebMvcConfigurer {
    @Autowired
    AuthHandlerInterceptor authHandlerInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(authHandlerInterceptor).addPathPatterns("/api/**");
    }
}